﻿using System;
using System.IO;
using System.Reflection;
namespace GToolKit.IO
{


    public class CommonIO
    {
        /// <summary>
        /// Get the resource to stream.
        /// </summary>
        /// <param name="type">The type of resource.</param>
        /// <param name="resourceName">The path of source.</param>
        /// <returns>The resource stream.</returns>
        public static Stream GetFromResources(Type type, string resourceName)
        {
            Assembly assem = type.Assembly;
            Stream stream = assem.GetManifestResourceStream(resourceName);
            return stream;
        }
    }
}
